package com.example.twopointers;

public class ReverseStr {
    public static void main(String[] args) {
        System.out.println(reverseStr(new char[]{'h', 'e', 'l', 'o'}));
    }
    public static char[] reverseStr(char[] ch){
        int len=ch.length;
        int i=0;
        int j=len-1;
        while (i<j){
            char temp=ch[i];
            ch[i]=ch[j];
            ch[j]=temp;
            i++;
            j--;
        }
        return ch;
    }
}
